<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="搬砖 嵌入式">
<meta property="og:type" content="website">
<meta property="og:title" content="学无止境">
<meta property="og:url" content="http://example.com/page/13/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="搬砖 嵌入式">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="xudonglei">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/page/13/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/17/%E6%9D%B0%E7%90%86%E4%B8%80%E6%8B%96%E5%85%AB%E7%83%A7%E5%BD%95%E5%99%A8%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/02/17/%E6%9D%B0%E7%90%86%E4%B8%80%E6%8B%96%E5%85%AB%E7%83%A7%E5%BD%95%E5%99%A8%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B/" class="post-title-link" itemprop="url">杰理一拖八烧录器基本使用流程</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-02-17 09:21:09" itemprop="dateCreated datePublished" datetime="2023-02-17T09:21:09+08:00">2023-02-17</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2023/02/17/%E6%9D%B0%E7%90%86%E4%B8%80%E6%8B%96%E5%85%AB%E7%83%A7%E5%BD%95%E5%99%A8%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B/" class="post-meta-item leancloud_visitors" data-flag-title="杰理一拖八烧录器基本使用流程" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/02/17/%E6%9D%B0%E7%90%86%E4%B8%80%E6%8B%96%E5%85%AB%E7%83%A7%E5%BD%95%E5%99%A8%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/02/17/%E6%9D%B0%E7%90%86%E4%B8%80%E6%8B%96%E5%85%AB%E7%83%A7%E5%BD%95%E5%99%A8%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/burner_1tuo8_image5.png" style="zoom:65%;">

<h3 id="1-烧写文件授权"><a href="#1-烧写文件授权" class="headerlink" title="1.烧写文件授权"></a>1.烧写文件授权</h3><p>​        一拖八烧写器的 fw 文件必须授权才能加载烧写，烧写文件无需要限制烧写次数，可使用无限制模式进行授权。操作后会生成文件：jl_isd_[已授权].fw。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214123023.png" style="zoom:77%;">

<h3 id="2-更新目标芯片程序到烧写器"><a href="#2-更新目标芯片程序到烧写器" class="headerlink" title="2.更新目标芯片程序到烧写器"></a>2.更新目标芯片程序到烧写器</h3><p>​        连接好usb线，如下图：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信图片_20230214123435.jpg" style="zoom:30%;">

<p>打开burner.exe。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214123519.png" style="zoom:67%;">

<p>点击“文件”，“部署”，再选择相应的芯片型号。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214123609.png" style="zoom:50%;">

<p>再选择相应的文件，再点击部署：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214123759.png" style="zoom:50%;">

<p>成功后会跳出窗口：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214123905.png" style="zoom:50%;">

<h3 id="3-烧录程序到mcu"><a href="#3-烧录程序到mcu" class="headerlink" title="3.烧录程序到mcu"></a>3.烧录程序到mcu</h3><p>​        烧写器工作模式通过烧写器上的拨码开关进行设置，确保是在烧写模式。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214124138.png" style="zoom:50%;">

<p>​        烧写器上电开机后，显示屏上显示烧写信息部分显示有当前的工作模式，如显示屏工作模式显示所示。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/burner_1tuo8_image20.png" style="zoom:67%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/burner_1tuo8_image21.png" style="zoom:67%;">

<p>注意：(1)demo板的VBAT,DM,DP,GND直接通过usb连接到量产烧录器的usb口上，中间不要接JL USB Updater。</p>
<p>(2)烧录前，8路的USB烧录接口和状态指示灯是灭的，都不亮的，这个是正常现象。烧写和烧写完成后才会有灯的亮灭，情况如下表所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230214125203.png" style="zoom:67%;">


      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/17/Verilog%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/02/17/Verilog%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/" class="post-title-link" itemprop="url">Verilog的数据类型</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-02-17 08:17:28" itemprop="dateCreated datePublished" datetime="2023-02-17T08:17:28+08:00">2023-02-17</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/FPGA/" itemprop="url" rel="index"><span itemprop="name">FPGA</span></a>
                </span>
            </span>

          
            <span id="/2023/02/17/Verilog%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/" class="post-meta-item leancloud_visitors" data-flag-title="Verilog的数据类型" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/02/17/Verilog%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/02/17/Verilog%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        原文地址：<a target="_blank" rel="noopener" href="https://blog.csdn.net/Reborn_Lee/article/details/106970881">https://blog.csdn.net/Reborn_Lee/article/details/106970881</a></p>
<p>​        这里主要讲的是Verilog HDL中的数据类型，最常用的数据类型，无非就三种，reg、wire，integer；其中integer 主要在for 循环中使用。</p>
<h3 id="变量的取值"><a href="#变量的取值" class="headerlink" title="变量的取值"></a>变量的取值</h3><p>​        由于是数字电路，固然是0和1，还有高阻态 Z以及未知态X。高阻态是一个数字电路里常见的术语，指的是电路的一种输出状态，既不是高电平也不是低电平，如果高阻态再输入下一级电路的话，对下级电路无任何影响，和没接一样，类似于引脚悬空，如果用万用表测的话有可能是高电平也有可能是低电平，随它后面接的东西定。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302170821877.png" style="zoom:70%;">

<h3 id="变量的取值意味着什么？"><a href="#变量的取值意味着什么？" class="headerlink" title="变量的取值意味着什么？"></a>变量的取值意味着什么？</h3><p>​        Verilog是一种硬件描述语言，用于描述触发器，与非门等等一系列的硬件逻辑，因此，其逻辑取值应该在硬件电路中有所对应！</p>
<p>​        逻辑1代表着电源电压Vdd，逻辑0代表着接地！<br>​        未知态X可以是0也可以是1，这与布尔代数有所差异，其表示无关！<br>​        高阻态Z表示未连接任何导线，悬空。</p>
<h3 id="主要的数据类型"><a href="#主要的数据类型" class="headerlink" title="主要的数据类型"></a>主要的数据类型</h3><p>​        主要的数据类型，<strong>莫过于reg类型和wire类型，Verilog几乎可以用这两种类型通吃了</strong>。</p>
<p><strong>（1）</strong></p>
<p>​        wire类似于将两个部件在电路板上连接起来，它用于硬件实体之间的连接，因此不会存储任何值，仅仅起到连接元件的作用：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302170824952.png" style="zoom:80%;">

<p>​        如果需要多个连线，还可以设置wire的位宽，相当于将几个线捆扎在一起：wire [3:0] n0;</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302170825326.png" style="zoom:80%;">

<p><strong>（2）</strong>        </p>
<p>​        reg类型变量可用于数据的存储，其可以看做是register的缩写，也即是寄存器！</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302170826096.png" style="zoom:80%;">

<p>​        上面的定义，相当于分别定义了一个4bit的存储空间和一个8bit的存储空间，可以用来存储数值。</p>
<p>​        下图显示了，这种变量在硬件电路中的等价：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302170828607.png" style="zoom:80%;">

<p><strong>(3)</strong></p>
<p>​        其他数据类型integer</p>
<p>​        除了wire以及reg型变量，另一个比较常用的便是integer数据类型了，它表示了32bit的数据宽度，用来存储整型值，我们在for循环中常常用到它，例如：</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span>(<span class="keyword">integer</span> i = <span class="number">0</span>; i &lt; <span class="number">10</span>; i = i + <span class="number">1</span>) <span class="keyword">begin</span></span><br><span class="line"><span class="comment">//......</span></span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"></span><br><span class="line">或者</span><br><span class="line"><span class="keyword">integer</span> i = <span class="number">0</span>;</span><br><span class="line"><span class="keyword">for</span>(i = <span class="number">0</span>; i &lt; <span class="number">10</span>; i = i + <span class="number">1</span>) <span class="keyword">begin</span></span><br><span class="line"><span class="comment">//......</span></span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>
<p><strong>（4）</strong></p>
<p>​        time / realtime<br>​        这两种类型一般用于仿真，time类型是一个无符号，64bit宽的数据类型，可以用来存储仿真时间用于调试。realtime的区别在于仅存储浮点型数据。</p>
<p><strong>（5）</strong></p>
<p>​        real<br>​        real型变量可以存储浮点值，可以像整数和reg一样进行赋值。</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">real</span>   float;    <span class="comment">// float = 12.344  - can store floating numbers</span></span><br></pre></td></tr></table></figure>
<p><strong>(6)</strong></p>
<p>​        Verilog的字符串<br>​        字符串在reg中被还原，reg变量的宽度必须足够大，以容纳字符串。字符串中的每个字符代表一个ASCll值，需要1个字节。如果变量的大小小于字符串，那么Verilog会截断字符串的最左边的位;如果变量的大小大于字符串，那么Verilog会在字符串的左边添加0。</p>
<figure class="highlight verilog"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"> <span class="comment">// &quot;Hello World&quot; requires 11 byte</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">reg</span> [<span class="number">8</span>*<span class="number">11</span>:<span class="number">1</span>] str = <span class="string">&quot;Hello World&quot;</span>;  <span class="comment">// Variable can store 11 bytes, str = &quot;Hello World&quot;</span></span><br><span class="line"><span class="keyword">reg</span> [<span class="number">8</span>*<span class="number">5</span>:<span class="number">1</span>]  str = <span class="string">&quot;Hello World&quot;</span>;  <span class="comment">// Variable stores only 5 bytes (rest is truncated), str = &quot;World&quot;</span></span><br><span class="line"><span class="keyword">reg</span> [<span class="number">8</span>*<span class="number">20</span>:<span class="number">1</span>] str = <span class="string">&quot;Hello World&quot;</span>;  <span class="comment">// Variable can store 20 bytes (rest is padded with zeros), str = &quot;         Hello World&quot;</span></span><br></pre></td></tr></table></figure>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/12/%E5%BB%BA%E7%AB%8B%E6%97%B6%E9%97%B4%E5%92%8C%E4%BF%9D%E6%8C%81%E6%97%B6%E9%97%B4/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/02/12/%E5%BB%BA%E7%AB%8B%E6%97%B6%E9%97%B4%E5%92%8C%E4%BF%9D%E6%8C%81%E6%97%B6%E9%97%B4/" class="post-title-link" itemprop="url">建立时间和保持时间</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-02-12 13:17:28" itemprop="dateCreated datePublished" datetime="2023-02-12T13:17:28+08:00">2023-02-12</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/FPGA/" itemprop="url" rel="index"><span itemprop="name">FPGA</span></a>
                </span>
            </span>

          
            <span id="/2023/02/12/%E5%BB%BA%E7%AB%8B%E6%97%B6%E9%97%B4%E5%92%8C%E4%BF%9D%E6%8C%81%E6%97%B6%E9%97%B4/" class="post-meta-item leancloud_visitors" data-flag-title="建立时间和保持时间" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/02/12/%E5%BB%BA%E7%AB%8B%E6%97%B6%E9%97%B4%E5%92%8C%E4%BF%9D%E6%8C%81%E6%97%B6%E9%97%B4/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/02/12/%E5%BB%BA%E7%AB%8B%E6%97%B6%E9%97%B4%E5%92%8C%E4%BF%9D%E6%8C%81%E6%97%B6%E9%97%B4/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        参考资料：<a target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1tS4y1a7Li/?spm_id_from=333.1007.top_right_bar_window_custom_collection.content.click&amp;vd_source=2ef3411e1c045a25cc2351abaa2c3ce8">https://www.bilibili.com/video/BV1tS4y1a7Li/?spm_id_from=333.1007.top_right_bar_window_custom_collection.content.click&amp;vd_source=2ef3411e1c045a25cc2351abaa2c3ce8</a></p>
<p>​        时序电路最基本的单元就是D触发器，如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302082102643.png" style="zoom:60%;">

<p>CLK从0变到1的时候，数据D就被打入锁存起来。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302082109349.png" style="zoom:67%;">

<p>​        建立时间说明数据要提前准备好，保持时间说明数据在上升沿到来之后要稳定一段时间。</p>
<h3 id="建立时间"><a href="#建立时间" class="headerlink" title="建立时间"></a>建立时间</h3><p>​        在电路里面基本会抽象成两个D触发器，然后中间会隔一个组合逻辑。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302082114722.png" style="zoom:70%;">

<p>clk到达D1和D2，都是有线的，是有延时的。我们归一化一下，认为到D1是没有延时的，那么换算一下，到D2是Tclk2-Tclk1，我们把它叫做时钟的偏斜。时钟的偏斜如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302082119247.png" style="zoom:67%;">

<p>​        当data在上升沿发出的时候(我们叫它发射沿)，接收是在D2的上升沿(我们叫它接受沿)，如下图所示：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302082122577.png" style="zoom:67%;">

<p>​    为了满足建立时间，数据到D2的时间要在上面红色区域的左边。我们现在假设数据在D1上升沿到来的时候被打入D1寄存器，并且传过去到D2，到达D1的输出端口如下图：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302082126015.png" style="zoom:67%;">

<p>会有一段延时Tco，因为D1里面是一大堆门电路。</p>
<p>data再经过组合逻辑，也会有一段延时，因为组合逻辑电路也是一堆门电路，我们把它叫做Tcomb，如下图所示。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302111137864.png" style="zoom:67%;">

<p>这个时候D2的时钟上升沿还没有到来，在Tsetup的左边就稳定了，就认为建立时间是满足要求的。</p>
<p>​        那什么时候是建立时间不满足的呢？假如下图中组合逻辑写的非常的垃圾，它的Tcomb就非常的长，就不满足建立时间的要求了。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302112051774.png" style="zoom:67%;">

<p>要满足建立时间，必须满足下面这条式子：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302112057857.png" style="zoom:67%;">

<h3 id="保持时间"><a href="#保持时间" class="headerlink" title="保持时间"></a>保持时间</h3><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302112103842.png" style="zoom:67%;">

<p>数据到来之后，必须保持红色区域这段时间。必须在红色区域右边，那个DATA_last才允许变化。</p>
<p>​        下面具体分析一下过程：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302112107906.png" style="zoom:67%;">

<p>​        Data_new通过D1到达组合逻辑的前面，经过Tco:</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302120959961.png" style="zoom:67%;">

<p>​        然后又经过一个组合逻辑，到达了D2的门口：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302121000687.png" style="zoom:67%;">

<p>​        但是你看上图那个保持时间肯定是违例的，因为DATA_last还没有保持到红色区域外。</p>
<p>​        那我们如何让保持时间满足要求呢？</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302121003693.png" style="zoom:67%;">
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/06/%E4%B8%89%E6%80%81%E4%B9%8B%E9%AB%98%E9%98%BB%E6%80%81/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/02/06/%E4%B8%89%E6%80%81%E4%B9%8B%E9%AB%98%E9%98%BB%E6%80%81/" class="post-title-link" itemprop="url">三态之高阻态</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-02-06 21:45:19" itemprop="dateCreated datePublished" datetime="2023-02-06T21:45:19+08:00">2023-02-06</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%A1%AC%E4%BB%B6/" itemprop="url" rel="index"><span itemprop="name">硬件</span></a>
                </span>
            </span>

          
            <span id="/2023/02/06/%E4%B8%89%E6%80%81%E4%B9%8B%E9%AB%98%E9%98%BB%E6%80%81/" class="post-meta-item leancloud_visitors" data-flag-title="三态之高阻态" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/02/06/%E4%B8%89%E6%80%81%E4%B9%8B%E9%AB%98%E9%98%BB%E6%80%81/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/02/06/%E4%B8%89%E6%80%81%E4%B9%8B%E9%AB%98%E9%98%BB%E6%80%81/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    原文地址：<a target="_blank" rel="noopener" href="https://blog.csdn.net/Reborn_Lee/article/details/88728527?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159315879219195162531175%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&amp;request_id=159315879219195162531175&amp;biz_id=0&amp;utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_v1~rank_blog_v1-1-88728527.pc_v1_rank_blog_v1&amp;utm_term=%E9%AB%98%E9%98%BB%E6%80%81">https://blog.csdn.net/Reborn_Lee/article/details/88728527?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159315879219195162531175%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&amp;request_id=159315879219195162531175&amp;biz_id=0&amp;utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_v1~rank_blog_v1-1-88728527.pc_v1_rank_blog_v1&amp;utm_term=%E9%AB%98%E9%98%BB%E6%80%81</a></p>
<p>​        对于各种器件的输出引脚，讲到三态，高电平输出、低电平输出、及高阻态。其中的高阻。基本上有硬件常识的人都清楚其作用主要有：节电、将该引脚电流效果上断开，避免其对系统上其它电路的不良影响。</p>
<p>​        然而对于输入引脚也有引脚，好多人都不理解，并认为没有必要。其实输入引脚，在我们的系统中非常常见，比如各种RAM芯片的引脚，输入时，如果\CS为高电平，则大多处于高阻状态。FPGA设计的书上或是各大牛人也通常会告诫我们，不用的引脚一定要设为高阻态。<br>​        除共同的节电作用外。高阻态引脚，输出高阻态你可以看着避免对别人产生影响。而输入高阻态状态，既避免对别人产生影响，还避免了受到别人的影响。<br><strong>总结：</strong></p>
<p>​        输出高阻态就是避免对别人产生影响，而输入高阻态，既避免对别人产生影响，又避免了受到别人的影响。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/05/Verilog%E7%9A%84module/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/02/05/Verilog%E7%9A%84module/" class="post-title-link" itemprop="url">Verilog的module</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-02-05 19:05:33" itemprop="dateCreated datePublished" datetime="2023-02-05T19:05:33+08:00">2023-02-05</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/FPGA/" itemprop="url" rel="index"><span itemprop="name">FPGA</span></a>
                </span>
            </span>

          
            <span id="/2023/02/05/Verilog%E7%9A%84module/" class="post-meta-item leancloud_visitors" data-flag-title="Verilog的module" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/02/05/Verilog%E7%9A%84module/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/02/05/Verilog%E7%9A%84module/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        参考资料：<a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/552542569">https://zhuanlan.zhihu.com/p/552542569</a></p>
<p>​                            <a target="_blank" rel="noopener" href="https://liudongdong.blog.csdn.net/article/details/80993203?spm=1001.2101.3001.6650.3&amp;utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-80993203-blog-116206369.pc_relevant_3mothn_strategy_and_data_recovery&amp;depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-80993203-blog-116206369.pc_relevant_3mothn_strategy_and_data_recovery&amp;utm_relevant_index=5">https://liudongdong.blog.csdn.net/article/details/80993203?spm=1001.2101.3001.6650.3&amp;utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-3-80993203-blog-116206369.pc_relevant_3mothn_strategy_and_data_recovery&amp;depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-3-80993203-blog-116206369.pc_relevant_3mothn_strategy_and_data_recovery&amp;utm_relevant_index=5</a></p>
<p>​        module是verilog中的基本机构，类似软件代码中函数的概念。module的本质其实是一个电路，是用verilog语言去描述实现的电路。</p>
<p>​        module编写好之后，需要进行仿真。类似软件开发中，写好一个函数，然后对函数进行测试。如何对函数进行测试呢，提前准备好一些测试数据，输入到函数中去，然后看看处理的结果是否正确。仿真也是类似的，向module输入一组测试波形（本质就是0和1的组合），看看module处理地是否正确。</p>
<p>​        Verilog的基本设计单元是模块（block）。一个模块是有两部分组成的 ，一部分描述接口，另一部分描述逻辑功能，及定义输入时如何影响输出的。下图为模块结构的组成。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202302051930243.png" style="zoom:80%;">

<p><strong>module特点：</strong></p>
<p>1.每个模块的内容都是嵌在module和endmodule两个语句之间。每个模块实现特定的功能。模块可以进行层次嵌套。</p>
<p>2.每个模块要进行端口定义,并说明输入输出口,然后对模块的功能进行行为逻辑描述。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/01/%E6%9D%B0%E7%90%86MCU%E4%B8%B2%E5%8F%A3%E4%BD%BF%E7%94%A8DMA%E6%96%B9%E5%BC%8F%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E6%B3%A8%E6%84%8F%E7%82%B9/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/02/01/%E6%9D%B0%E7%90%86MCU%E4%B8%B2%E5%8F%A3%E4%BD%BF%E7%94%A8DMA%E6%96%B9%E5%BC%8F%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E6%B3%A8%E6%84%8F%E7%82%B9/" class="post-title-link" itemprop="url">杰理MCU串口使用DMA方式接收数据注意点</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-02-01 12:49:09" itemprop="dateCreated datePublished" datetime="2023-02-01T12:49:09+08:00">2023-02-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2023/02/01/%E6%9D%B0%E7%90%86MCU%E4%B8%B2%E5%8F%A3%E4%BD%BF%E7%94%A8DMA%E6%96%B9%E5%BC%8F%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E6%B3%A8%E6%84%8F%E7%82%B9/" class="post-meta-item leancloud_visitors" data-flag-title="杰理MCU串口使用DMA方式接收数据注意点" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/02/01/%E6%9D%B0%E7%90%86MCU%E4%B8%B2%E5%8F%A3%E4%BD%BF%E7%94%A8DMA%E6%96%B9%E5%BC%8F%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E6%B3%A8%E6%84%8F%E7%82%B9/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/02/01/%E6%9D%B0%E7%90%86MCU%E4%B8%B2%E5%8F%A3%E4%BD%BF%E7%94%A8DMA%E6%96%B9%E5%BC%8F%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E6%B3%A8%E6%84%8F%E7%82%B9/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    项目中有一段代码是用串口dma接收数据用的，一开始用的波特率是256000，没出现啥问题，后来因为项目需要，波特率改成1200，接收就出现了问题。通过调试，发现以下现象。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230201123825.png" style="zoom:80%;">

<p>当使用256000的时候，串口发送5个字节的数据，只进入这个函数一次，打印出len长度为5。当波特率改成9600时，进入这个函数两次，分别打印len的长度为3，2。当波特率改成1200后，进入这个函数多次，并且有时候len长度为0。</p>
<p>​    问题的根本原因如下：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230201124253.png" style="zoom:80%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230201124443.png" style="zoom:80%;">

<p>当波特率改小后，同样长度的数据，发送的时间就长了，多次进入了中断。</p>
<p>​    解决办法：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230201124831.png" style="zoom:80%;">

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/01/29/pyqtgraph%20docker/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/01/29/pyqtgraph%20docker/" class="post-title-link" itemprop="url">pyqtgraph docker</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-01-29 12:22:00" itemprop="dateCreated datePublished" datetime="2023-01-29T12:22:00+08:00">2023-01-29</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2023/01/29/pyqtgraph%20docker/" class="post-meta-item leancloud_visitors" data-flag-title="pyqtgraph docker" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/01/29/pyqtgraph%20docker/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/01/29/pyqtgraph%20docker/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    原文地址：<a target="_blank" rel="noopener" href="https://blog.csdn.net/Hodors/article/details/112325688">https://blog.csdn.net/Hodors/article/details/112325688</a></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">This example demonstrates the use of pyqtgraph&#x27;s dock widget system.</span></span><br><span class="line"><span class="string">The dockarea system allows the design of user interfaces which can be rearranged by</span></span><br><span class="line"><span class="string">the user at runtime. Docks can be moved, resized, stacked, and torn out of the main</span></span><br><span class="line"><span class="string">window. This is similar in principle to the docking system built into Qt, but </span></span><br><span class="line"><span class="string">offers a more deterministic dock placement API (in Qt it is very difficult to </span></span><br><span class="line"><span class="string">programatically generate complex dock arrangements). Additionally, Qt&#x27;s docks are </span></span><br><span class="line"><span class="string">designed to be used as small panels around the outer edge of a window. Pyqtgraph&#x27;s </span></span><br><span class="line"><span class="string">docks were created with the notion that the entire window (or any portion of it) </span></span><br><span class="line"><span class="string">would consist of dockable components.</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"><span class="keyword">import</span> initExample <span class="comment">## Add path to library (just for examples; you do not need this)</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">import</span> pyqtgraph <span class="keyword">as</span> pg</span><br><span class="line"><span class="keyword">from</span> pyqtgraph.Qt <span class="keyword">import</span> QtCore, QtGui</span><br><span class="line"><span class="keyword">import</span> pyqtgraph.console</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"> </span><br><span class="line"><span class="keyword">from</span> pyqtgraph.dockarea <span class="keyword">import</span> *</span><br><span class="line"> </span><br><span class="line">app = QtGui.QApplication([])</span><br><span class="line">win = QtGui.QMainWindow()</span><br><span class="line">area = DockArea()</span><br><span class="line">win.setCentralWidget(area)</span><br><span class="line">win.resize(<span class="number">1000</span>,<span class="number">500</span>)</span><br><span class="line">win.setWindowTitle(<span class="string">&#x27;pyqtgraph example: dockarea&#x27;</span>)</span><br><span class="line"> </span><br><span class="line"><span class="comment">## Create docks, place them into the window one at a time.</span></span><br><span class="line"><span class="comment">## Note that size arguments are only a suggestion; docks will still have to</span></span><br><span class="line"><span class="comment">## fill the entire dock area and obey the limits of their internal widgets.</span></span><br><span class="line">d1 = Dock(<span class="string">&quot;Dock1&quot;</span>, size=(<span class="number">1</span>, <span class="number">1</span>))     <span class="comment">## give this dock the minimum possible size</span></span><br><span class="line">d2 = Dock(<span class="string">&quot;Dock2 - Console&quot;</span>, size=(<span class="number">500</span>,<span class="number">300</span>), closable=<span class="literal">True</span>)</span><br><span class="line">d3 = Dock(<span class="string">&quot;Dock3&quot;</span>, size=(<span class="number">500</span>,<span class="number">400</span>))</span><br><span class="line">d4 = Dock(<span class="string">&quot;Dock4 (tabbed) - Plot&quot;</span>, size=(<span class="number">500</span>,<span class="number">200</span>))</span><br><span class="line">d5 = Dock(<span class="string">&quot;Dock5 - Image&quot;</span>, size=(<span class="number">500</span>,<span class="number">200</span>))</span><br><span class="line">d6 = Dock(<span class="string">&quot;Dock6 (tabbed) - Plot&quot;</span>, size=(<span class="number">500</span>,<span class="number">200</span>))</span><br><span class="line">area.addDock(d1, <span class="string">&#x27;left&#x27;</span>)      <span class="comment">## place d1 at left edge of dock area (it will fill the whole space since there are no other docks yet)</span></span><br><span class="line">area.addDock(d2, <span class="string">&#x27;right&#x27;</span>)     <span class="comment">## place d2 at right edge of dock area</span></span><br><span class="line">area.addDock(d3, <span class="string">&#x27;bottom&#x27;</span>, d1)<span class="comment">## place d3 at bottom edge of d1</span></span><br><span class="line">area.addDock(d4, <span class="string">&#x27;right&#x27;</span>)     <span class="comment">## place d4 at right edge of dock area</span></span><br><span class="line">area.addDock(d5, <span class="string">&#x27;left&#x27;</span>, d1)  <span class="comment">## place d5 at left edge of d1</span></span><br><span class="line">area.addDock(d6, <span class="string">&#x27;top&#x27;</span>, d4)   <span class="comment">## place d5 at top edge of d4</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">## Test ability to move docks programatically after they have been placed</span></span><br><span class="line">area.moveDock(d4, <span class="string">&#x27;top&#x27;</span>, d2)     <span class="comment">## move d4 to top edge of d2</span></span><br><span class="line">area.moveDock(d6, <span class="string">&#x27;above&#x27;</span>, d4)   <span class="comment">## move d6 to stack on top of d4</span></span><br><span class="line">area.moveDock(d5, <span class="string">&#x27;top&#x27;</span>, d2)     <span class="comment">## move d5 to top edge of d2</span></span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"><span class="comment">## Add widgets into each dock</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">## first dock gets save/restore buttons</span></span><br><span class="line">w1 = pg.LayoutWidget()</span><br><span class="line">label = QtGui.QLabel(<span class="string">&quot;&quot;&quot; -- DockArea Example -- </span></span><br><span class="line"><span class="string">This window has 6 Dock widgets in it. Each dock can be dragged</span></span><br><span class="line"><span class="string">by its title bar to occupy a different space within the window </span></span><br><span class="line"><span class="string">but note that one dock has its title bar hidden). Additionally,</span></span><br><span class="line"><span class="string">the borders between docks may be dragged to resize. Docks that are dragged on top</span></span><br><span class="line"><span class="string">of one another are stacked in a tabbed layout. Double-click a dock title</span></span><br><span class="line"><span class="string">bar to place it in its own window.</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span>)</span><br><span class="line">saveBtn = QtGui.QPushButton(<span class="string">&#x27;Save dock state&#x27;</span>)</span><br><span class="line">restoreBtn = QtGui.QPushButton(<span class="string">&#x27;Restore dock state&#x27;</span>)</span><br><span class="line">restoreBtn.setEnabled(<span class="literal">False</span>)</span><br><span class="line">w1.addWidget(label, row=<span class="number">0</span>, col=<span class="number">0</span>)</span><br><span class="line">w1.addWidget(saveBtn, row=<span class="number">1</span>, col=<span class="number">0</span>)</span><br><span class="line">w1.addWidget(restoreBtn, row=<span class="number">2</span>, col=<span class="number">0</span>)</span><br><span class="line">d1.addWidget(w1)</span><br><span class="line">state = <span class="literal">None</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">save</span>():</span></span><br><span class="line">    <span class="keyword">global</span> state</span><br><span class="line">    state = area.saveState()</span><br><span class="line">    restoreBtn.setEnabled(<span class="literal">True</span>)</span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">load</span>():</span></span><br><span class="line">    <span class="keyword">global</span> state</span><br><span class="line">    area.restoreState(state)</span><br><span class="line">saveBtn.clicked.connect(save)</span><br><span class="line">restoreBtn.clicked.connect(load)</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">w2 = pg.console.ConsoleWidget()</span><br><span class="line">d2.addWidget(w2)</span><br><span class="line"> </span><br><span class="line"><span class="comment">## Hide title bar on dock 3</span></span><br><span class="line">d3.hideTitleBar()</span><br><span class="line">w3 = pg.PlotWidget(title=<span class="string">&quot;Plot inside dock with no title bar&quot;</span>)</span><br><span class="line">w3.plot(np.random.normal(size=<span class="number">100</span>))</span><br><span class="line">d3.addWidget(w3)</span><br><span class="line"> </span><br><span class="line">w4 = pg.PlotWidget(title=<span class="string">&quot;Dock 4 plot&quot;</span>)</span><br><span class="line">w4.plot(np.random.normal(size=<span class="number">100</span>))</span><br><span class="line">d4.addWidget(w4)</span><br><span class="line"> </span><br><span class="line">w5 = pg.ImageView()</span><br><span class="line">w5.setImage(np.random.normal(size=(<span class="number">100</span>,<span class="number">100</span>)))</span><br><span class="line">d5.addWidget(w5)</span><br><span class="line"> </span><br><span class="line">w6 = pg.PlotWidget(title=<span class="string">&quot;Dock 6 plot&quot;</span>)</span><br><span class="line">w6.plot(np.random.normal(size=<span class="number">100</span>))</span><br><span class="line">d6.addWidget(w6)</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line">win.show()</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"><span class="comment">## Start Qt event loop unless running in interactive mode or using pyside.</span></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">&#x27;__main__&#x27;</span>:</span><br><span class="line">    <span class="keyword">import</span> sys</span><br><span class="line">    <span class="keyword">if</span> (sys.flags.interactive != <span class="number">1</span>) <span class="keyword">or</span> <span class="keyword">not</span> <span class="built_in">hasattr</span>(QtCore, <span class="string">&#x27;PYQT_VERSION&#x27;</span>):</span><br><span class="line">        QtGui.QApplication.instance().exec_()</span><br></pre></td></tr></table></figure>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/01/16/%E5%9C%A8PyQt%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E5%B5%8C%E5%85%A5Matplotlib%E5%9B%BE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/01/16/%E5%9C%A8PyQt%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E5%B5%8C%E5%85%A5Matplotlib%E5%9B%BE/" class="post-title-link" itemprop="url">在PyQt应用程序中嵌入Matplotlib图</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2023-01-16 19:22:39" itemprop="dateCreated datePublished" datetime="2023-01-16T19:22:39+08:00">2023-01-16</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2023/01/16/%E5%9C%A8PyQt%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E5%B5%8C%E5%85%A5Matplotlib%E5%9B%BE/" class="post-meta-item leancloud_visitors" data-flag-title="在PyQt应用程序中嵌入Matplotlib图" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2023/01/16/%E5%9C%A8PyQt%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E5%B5%8C%E5%85%A5Matplotlib%E5%9B%BE/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2023/01/16/%E5%9C%A8PyQt%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E5%B5%8C%E5%85%A5Matplotlib%E5%9B%BE/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​    原文地址：<a target="_blank" rel="noopener" href="https://blog.csdn.net/u013278255/article/details/127193317">https://blog.csdn.net/u013278255/article/details/127193317</a></p>
<h3 id="一个简单的例子"><a href="#一个简单的例子" class="headerlink" title="一个简单的例子"></a>一个简单的例子</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"><span class="keyword">import</span> matplotlib</span><br><span class="line">matplotlib.use(<span class="string">&#x27;Qt5Agg&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> PyQt5 <span class="keyword">import</span> QtCore, QtWidgets</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> matplotlib.backends.backend_qt5agg <span class="keyword">import</span> FigureCanvasQTAgg</span><br><span class="line"><span class="keyword">from</span> matplotlib.figure <span class="keyword">import</span> Figure</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MplCanvas</span>(<span class="params">FigureCanvasQTAgg</span>):</span></span><br><span class="line">	<span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">	figure 模块提供了顶级 Artist，即 Figure，其中包含所有绘图元素。</span></span><br><span class="line"><span class="string">	该模块用于控制所有绘图元素的子图和顶级容器的默认间距</span></span><br><span class="line"><span class="string">	使用的目的plt.figure()是创建一个图形对象。</span></span><br><span class="line"><span class="string">	整个图形被视为图形对象。当我们想要调整图形的大小以及想要在单个图形中添加多个 Axes 对象时，</span></span><br><span class="line"><span class="string">	必须显式使用</span></span><br><span class="line"><span class="string">	add_subplot添加一个绘图区作为子图排列的一部分，网格“111”表示“1x1 网格，第一个子图</span></span><br><span class="line"><span class="string">	&quot;&quot;&quot;</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span>(<span class="params">self, parent=<span class="literal">None</span>, width=<span class="number">5</span>, height=<span class="number">4</span>, dpi=<span class="number">100</span></span>):</span></span><br><span class="line">        fig = Figure(figsize=(width, height), dpi=dpi)</span><br><span class="line">        self.axes = fig.add_subplot(<span class="number">111</span>)</span><br><span class="line">        <span class="built_in">super</span>(MplCanvas, self).__init__(fig)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MainWindow</span>(<span class="params">QtWidgets.QMainWindow</span>):</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span>(<span class="params">self, *args, **kwargs</span>):</span></span><br><span class="line">        <span class="built_in">super</span>(MainWindow, self).__init__(*args, **kwargs)</span><br><span class="line"></span><br><span class="line">        <span class="comment"># 创建 maptlotlib FigureCanvas 对象,</span></span><br><span class="line">        <span class="comment"># 绘制二维坐标轴.</span></span><br><span class="line">        sc = MplCanvas(self, width=<span class="number">5</span>, height=<span class="number">4</span>, dpi=<span class="number">100</span>)</span><br><span class="line">        sc.axes.plot([<span class="number">0</span>,<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>], [<span class="number">10</span>,<span class="number">1</span>,<span class="number">20</span>,<span class="number">3</span>,<span class="number">40</span>])</span><br><span class="line">        self.setCentralWidget(sc)</span><br><span class="line"></span><br><span class="line">        self.show()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">app = QtWidgets.QApplication(sys.argv)</span><br><span class="line">w = MainWindow()</span><br><span class="line">app.exec_()</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230116192334.png" style="zoom:50%;">

<h3 id="带有绘图控件"><a href="#带有绘图控件" class="headerlink" title="带有绘图控件"></a>带有绘图控件</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"><span class="keyword">import</span> matplotlib</span><br><span class="line">matplotlib.use(<span class="string">&#x27;Qt5Agg&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> PyQt5 <span class="keyword">import</span> QtCore, QtGui, QtWidgets</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> matplotlib.backends.backend_qt5agg <span class="keyword">import</span> FigureCanvasQTAgg, NavigationToolbar2QT <span class="keyword">as</span> NavigationToolbar</span><br><span class="line"><span class="keyword">from</span> matplotlib.figure <span class="keyword">import</span> Figure</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MplCanvas</span>(<span class="params">FigureCanvasQTAgg</span>):</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span>(<span class="params">self, parent=<span class="literal">None</span>, width=<span class="number">5</span>, height=<span class="number">4</span>, dpi=<span class="number">100</span></span>):</span></span><br><span class="line">        fig = Figure(figsize=(width, height), dpi=dpi)</span><br><span class="line">        self.axes = fig.add_subplot(<span class="number">111</span>)</span><br><span class="line">        <span class="built_in">super</span>(MplCanvas, self).__init__(fig)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MainWindow</span>(<span class="params">QtWidgets.QMainWindow</span>):</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span>(<span class="params">self, *args, **kwargs</span>):</span></span><br><span class="line">        <span class="built_in">super</span>(MainWindow, self).__init__(*args, **kwargs)</span><br><span class="line"></span><br><span class="line">        sc = MplCanvas(self, width=<span class="number">5</span>, height=<span class="number">4</span>, dpi=<span class="number">100</span>)</span><br><span class="line">        sc.axes.plot([<span class="number">0</span>,<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>], [<span class="number">10</span>,<span class="number">1</span>,<span class="number">20</span>,<span class="number">3</span>,<span class="number">40</span>])</span><br><span class="line"></span><br><span class="line">        <span class="comment"># 创建工具栏，将canvas作为第一个参数，parent (self，MainWindow) 作为第二个参数</span></span><br><span class="line">        toolbar = NavigationToolbar(sc, self)</span><br><span class="line"></span><br><span class="line">        layout = QtWidgets.QVBoxLayout()</span><br><span class="line">        layout.addWidget(toolbar)</span><br><span class="line">        layout.addWidget(sc)</span><br><span class="line"></span><br><span class="line">        <span class="comment"># 创建一个占位小部件来放置固定工具栏和画布.</span></span><br><span class="line">        widget = QtWidgets.QWidget()</span><br><span class="line">        widget.setLayout(layout)</span><br><span class="line">        self.setCentralWidget(widget)</span><br><span class="line"></span><br><span class="line">        self.show()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">app = QtWidgets.QApplication(sys.argv)</span><br><span class="line">w = MainWindow()</span><br><span class="line">app.exec_()</span><br></pre></td></tr></table></figure>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20230116192504.png" style="zoom:50%;">

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/12/25/%E9%9B%B7%E8%BE%BE%E6%96%B9%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/12/25/%E9%9B%B7%E8%BE%BE%E6%96%B9%E7%A8%8B/" class="post-title-link" itemprop="url">雷达方程</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-12-25 15:49:51" itemprop="dateCreated datePublished" datetime="2022-12-25T15:49:51+08:00">2022-12-25</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E9%9B%B7%E8%BE%BE/" itemprop="url" rel="index"><span itemprop="name">雷达</span></a>
                </span>
            </span>

          
            <span id="/2022/12/25/%E9%9B%B7%E8%BE%BE%E6%96%B9%E7%A8%8B/" class="post-meta-item leancloud_visitors" data-flag-title="雷达方程" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/12/25/%E9%9B%B7%E8%BE%BE%E6%96%B9%E7%A8%8B/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/12/25/%E9%9B%B7%E8%BE%BE%E6%96%B9%E7%A8%8B/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        描述雷达接收功率与目标雷达散射截面之间的关系式。雷达方程将雷达作用距离与发射机、接收机、天线和目标特性关联起来。它不仅用于确定某一特定雷达能够探测到的目标最大作用距离，而且可以作为研究影响雷达性能因素的一种手段，还是雷达系统设计中的一个重要辅助工具。</p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20221225155129.png"></p>
<p>​        对于点目标，接收功率按照雷达到达目标距离的四次方下降。雷达有效距离增加一倍，功率需要增加到原来的16倍（即12dB），或者将天线增益增加到原来的四倍（6dB）。</p>
<h3 id="分贝："><a href="#分贝：" class="headerlink" title="分贝："></a>分贝：</h3><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20221225163548.png" style="zoom:80%;">

<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20221225165048.png" style="zoom:80%;">

<h3 id="作用距离估算实例："><a href="#作用距离估算实例：" class="headerlink" title="作用距离估算实例："></a>作用距离估算实例：</h3><p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20221225171527.png"></p>
<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20221225171515.png"></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/12/10/rj45%E6%8E%A5%E5%8F%A3%E9%A1%BA%E5%BA%8F/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/12/10/rj45%E6%8E%A5%E5%8F%A3%E9%A1%BA%E5%BA%8F/" class="post-title-link" itemprop="url">rj45接口顺序</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-12-10 22:58:07" itemprop="dateCreated datePublished" datetime="2022-12-10T22:58:07+08:00">2022-12-10</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%A1%AC%E4%BB%B6/" itemprop="url" rel="index"><span itemprop="name">硬件</span></a>
                </span>
            </span>

          
            <span id="/2022/12/10/rj45%E6%8E%A5%E5%8F%A3%E9%A1%BA%E5%BA%8F/" class="post-meta-item leancloud_visitors" data-flag-title="rj45接口顺序" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/12/10/rj45%E6%8E%A5%E5%8F%A3%E9%A1%BA%E5%BA%8F/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/12/10/rj45%E6%8E%A5%E5%8F%A3%E9%A1%BA%E5%BA%8F/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>​        <img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202212102301298.png" style="zoom:80%;"></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/12/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/12/">12</a><span class="page-number current">13</span><a class="page-number" href="/page/14/">14</a><span class="space">&hellip;</span><a class="page-number" href="/page/29/">29</a><a class="extend next" rel="next" href="/page/14/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
